package com.example.everying.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.everying.model.entity.user.ActivityParticipation;
import com.example.everying.model.entity.user.PointsAccount;
import com.example.everying.model.vo.points.PointsAccountVo;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 积分账户Service接口
 */
public interface PointsAccountService extends IService<PointsAccount> {

    void  addPoints(String userId, Integer points, String remark,String type);

    @Transactional(rollbackFor = Exception.class)
    void addPointsAndParticipation(String userId, Integer points, String remark, String type, ActivityParticipation activityParticipation);

    @Transactional(rollbackFor = Exception.class)
    void  minusPoints(String userId, Integer points, String remark);

    PointsAccountVo getByUid(String userId);

    boolean createPointsAccount(String userId,Integer  points);

    boolean updatePoints(String userId, int points);

    int clearPoints(LocalDateTime time);

    void ccccc();

    boolean activityList(List<String> userId, Integer points);
}
